﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SuCasa.Infrastructure;

namespace SuCasa.Models
{
    public class MemberSearchViewModel
    {
        public MemberSearchViewModel()
        {
            
        }

        public MemberSearchViewModel(string searchStr, List<Member> members )
        {
            SearchStr = searchStr;
            SearchResults = members.Select(m => new MemberSearchResultViewModel()
            {
                MemberId = m.MemberId,
                Address = m.Address,
                CellPhone = m.CellPhone, Email = m.Email, HomePhone = m.HomePhone, 
                Name = m.Name
            }).ToList();
        }
        public string SearchStr { get; set; }
        public List<MemberSearchResultViewModel> SearchResults { get; set; } 

    }
}